<?php
	require('jacked_functions.php');
	
	if(!validateLogin()){
		exit();
	}
	
	require('jacked_configVars.php');
	require('jacked_configtweeter.php');
	
	$pageType = "jacked";
	$pageTitle = "JACKED Manager";
		
	require('bodyTop.php');
	echo JACKED_HEADING_STRING;
	
	require('lib/twat.php');
	
	$curTwitter = new twitter(JACKED_TWEETER_USER, JACKED_TWEETER_PASS);
	
	if (isset($_POST['submit'])) {

	$twitter_status = $_POST['twitter_stat'];
	
	if (strlen($twitter_status) > 0) {

		if( $curTwitter->setStatus($twitter_status) == true)
			$msg = "<p>Updated Succesfully.</p>";
		else
			$msg = "<p>Twitter is unavailable at this time. Failwhale.</p>";
	} else
		$msg = "<p>Error: I won't send blank messages, asshole.</p>";
}

?>	

   	<h2>JACKED Tweeter</h2>
   	
   	<?php echo $msg; ?>
   	
	<p><strong>What are you doing?</strong></p>
	<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
		<input name="twitter_stat" type="text" id="twitter_stat" size="40" maxlength="140" />
		<input type="submit" name="submit" id="submit" value="Send"/>
	</form>
	
<div class="blogspace"></div>
<a href="jacked_admin.php">Cancel/Back</a>


<?php	
	require('bodyBottom.php');
?>